home *** CD-ROM | disk | FTP | other *** search
- package koala.dynamicjava.interpreter;
-
- import koala.dynamicjava.interpreter.error.CatchedExceptionError;
- import koala.dynamicjava.interpreter.error.ExecutionError;
- import koala.dynamicjava.interpreter.throwable.ThrownException;
- import koala.dynamicjava.parser.wrapper.ParseError;
- import koala.dynamicjava.tree.Node;
-
- public class InterpreterException extends Exception {
- protected SourceInformation sourceInformation;
- protected String message;
-
- public SourceInformation getSourceInformation() {
- return this.sourceInformation;
- }
-
- public String getMessage() {
- return this.message;
- }
-
- public InterpreterException(ParseError var1) {
- if (var1.getLine() != -1) {
- this.sourceInformation = new SourceInformation(var1.getFilename(), var1.getLine(), var1.getColumn());
- this.message = "L" + var1.getLine() + ", C" + var1.getColumn() + " (" + var1.getFilename() + "):\n" + var1.getMessage();
- } else {
- this.message = var1.getMessage();
- }
-
- }
-
- public InterpreterException(ExecutionError var1) {
- Node var2 = var1.getNode();
- if (var2 != null && var2.getFilename() != null) {
- this.sourceInformation = new SourceInformation(var2.getFilename(), var2.getBeginLine(), var2.getBeginColumn());
- this.message = "L" + var2.getBeginLine() + ", C" + var2.getBeginColumn() + " (" + var2.getFilename() + "):\n";
- } else {
- this.message = "";
- }
-
- if (var1 instanceof CatchedExceptionError) {
- String var10001 = this.message;
- this.message = var10001 + ((CatchedExceptionError)var1).getException();
- } else if (var1 instanceof ThrownException) {
- String var3 = this.message;
- this.message = var3 + ((ThrownException)var1).getException();
- } else {
- String var4 = this.message;
- this.message = var4 + var1.getMessage();
- }
-
- }
- }
-